Skip to content

Conversation

@Sheeproid
Copy link
Contributor

No description provided.

@Sheeproid Sheeproid marked this pull request as draft January 14, 2026 12:57
@github-actions
Copy link

github-actions bot commented Jan 14, 2026

Docker image ready for a789e8f (built in 45s)

⚠️ Warning: does not support ARM (ARM images are built on release only - not on every PR)

Use this tag to pull the image for testing.

📋 Copy commands

⚠️ Temporary images are deleted after 30 days. Copy to a permanent registry before using them:

gcloud auth configure-docker us-central1-docker.pkg.dev
docker pull us-central1-docker.pkg.dev/robusta-development/temporary-builds/robusta-runner:a789e8f
docker tag us-central1-docker.pkg.dev/robusta-development/temporary-builds/robusta-runner:a789e8f me-west1-docker.pkg.dev/robusta-development/development/robusta-runner-dev:a789e8f
docker push me-west1-docker.pkg.dev/robusta-development/development/robusta-runner-dev:a789e8f

Patch Helm values in one line:

helm upgrade --install robusta robusta/robusta \
  --reuse-values \
  --set runner.image=me-west1-docker.pkg.dev/robusta-development/development/robusta-runner-dev:a789e8f

@coderabbitai
Copy link

coderabbitai bot commented Jan 14, 2026

Walkthrough

Adds four TCP keepalive environment constants, exposes them in env vars, applies keepalive socket options in the WebSocket receiver when enabled, adds debug logging around WebSocket ping/keepalive and action/stream handling, and updates Slack tests to fetch messages by timestamp.

Changes

Cohort / File(s) Summary
WebSocket TCP Keepalive Configuration
src/robusta/core/model/env_vars.py
Adds four public environment constants: WEBSOCKET_TCP_KEEPALIVE_ENABLED, WEBSOCKET_TCP_KEEPALIVE_IDLE, WEBSOCKET_TCP_KEEPALIVE_INTERVAL, WEBSOCKET_TCP_KEEPALIVE_COUNT.
WebSocket Receiver Implementation
src/robusta/integrations/receiver.py
Adds _get_tcp_keepalive_options() helper, applies keepalive sockopt to WebSocket run_forever when enabled, and adds conditional logging for ping and keepalive settings plus extra debug logs around action request handling and stream callbacks.
Tests — Slack message retrieval
tests/test_slack.py, tests/utils/slack_utils.py
tests/test_slack.py now uses the timestamp returned by SlackSender.send_finding_to_slack; tests/utils/slack_utils.py adds SlackChannel.get_message_by_ts(ts: str) to fetch a single message by timestamp.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive No description was provided by the author, making it impossible to assess whether any provided description relates to the changeset. Consider adding a pull request description explaining the motivation, implementation details, and testing approach for TCP keepalive support and logging additions.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main changes: TCP keepalive support and enhanced logging across the codebase.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch tcp-keepalive


📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cfbac23 and a268c9b.

📒 Files selected for processing (1)
  • tests/utils/slack_utils.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • tests/utils/slack_utils.py
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: run_tests
  • GitHub Check: run_tests

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@tests/utils/slack_utils.py`:
- Around line 26-36: The return type annotation of get_message_by_ts is
incorrect because it can return None; update the signature to return
Optional[str] and add the corresponding import from typing (e.g., from typing
import Optional), keeping the existing logic that uses
self.client.conversations_history and messages; ensure the annotation reads
Optional[str] for get_message_by_ts(self, ts: str) -> Optional[str].
🧹 Nitpick comments (2)
tests/test_slack.py (2)

26-27: Good improvement using timestamp-based retrieval for deterministic testing.

This avoids race conditions when tests share a channel. Consider adding an explicit None check for clearer failure messages if the message isn't found:

ts = slack_sender.send_finding_to_slack(finding, slack_params, False)
message = slack_channel.get_message_by_ts(ts)
assert message is not None, f"Message with ts={ts} not found"
assert message == msg

77-80: Consider updating other tests to use get_message_by_ts() for consistency.

This test and others (test_send_file_named_tempfile_fails, test_temporary_file_creation_failure) still use get_latest_message(). If the rationale for the change in test_send_to_slack applies here, these could be updated similarly by capturing the ts return value. This would align with the guidance in slack_utils.py to prefer timestamp-based retrieval.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e5fdee3 and cfbac23.

📒 Files selected for processing (2)
  • tests/test_slack.py
  • tests/utils/slack_utils.py
🧰 Additional context used
🧬 Code graph analysis (1)
tests/test_slack.py (2)
src/robusta/integrations/slack/sender.py (1)
  • send_finding_to_slack (660-682)
tests/utils/slack_utils.py (1)
  • get_message_by_ts (26-36)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: run_tests
  • GitHub Check: run_tests
🔇 Additional comments (1)
tests/utils/slack_utils.py (1)

20-24: Helpful comment for guiding users to the better API.

The note clarifies when to prefer timestamp-based retrieval over latest message retrieval.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants